﻿#ifndef INSTRUCTIONTHERMOSTATCONNECT
#define INSTRUCTIONTHERMOSTATCONNECT
#include "ScriptInstruction.h"

class InstructionThermostatConnect :public ScriptInstruction
{
  Q_OBJECT
private:
  ScriptRunner* scriptRunner = Q_NULLPTR;
  TurnTableCodec* turnTableCodec = Q_NULLPTR;
public:
  InstructionThermostatConnect()
  {
    scriptRunner = ScriptInstruction::getScriptRunner();
    turnTableCodec = ScriptInstruction::getTurnTableCodec();
    instructionFlag = Instruction_Thermostat_Connect;
  }
  ~InstructionThermostatConnect()
  {}
public:
  void run()override
  {
    turnTableCodec->sendInstruction(TurnTableCodec::Thermostat_Connect,0,0,0);
    scriptRunner->scriptWaitAndRun(scriptRunner->getInterval_instruction());
  }
  QVector<float> getDataForSaving()override
  {
    QVector<float> savingData;
    savingData.append(instructionFlag);
    return savingData;
  }
};
#endif
